\hypertarget{classmdp__field}{
\section{mdp\_\-field$<$ T $>$ Class Template Reference}
\label{classmdp__field}\index{mdp\_\-field@{mdp\_\-field}}
}
most generic field object  


{\tt \#include $<$mdp\_\-field.h$>$}

Collaboration diagram for mdp\_\-field$<$ T $>$:\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
\hypertarget{classmdp__field_b3e16ee58db96391a255579bc89d8535}{
\hyperlink{classmdp__field_b3e16ee58db96391a255579bc89d8535}{mdp\_\-field} ()}
\label{classmdp__field_b3e16ee58db96391a255579bc89d8535}

\begin{CompactList}\small\item\em declare empty field (zero size) \item\end{CompactList}\item 
\hypertarget{classmdp__field_aae273c82d9b0931e31f7265d5ca2652}{
\hyperlink{classmdp__field_aae273c82d9b0931e31f7265d5ca2652}{mdp\_\-field} (\hyperlink{classmdp__lattice}{mdp\_\-lattice} \&a, int n=1)}
\label{classmdp__field_aae273c82d9b0931e31f7265d5ca2652}

\begin{CompactList}\small\item\em declares a field on lattice a and allocates a vector of n T at each site \item\end{CompactList}\item 
\hypertarget{classmdp__field_d306195eb4961253cef69e5fb33bce69}{
bool \hyperlink{classmdp__field_d306195eb4961253cef69e5fb33bce69}{allocated} ()}
\label{classmdp__field_d306195eb4961253cef69e5fb33bce69}

\begin{CompactList}\small\item\em checks if a field is allocated of has zero-size \item\end{CompactList}\item 
\hypertarget{classmdp__field_b76ac5e0273aa3e1b5070fc3d7a0dc84}{
void \hyperlink{classmdp__field_b76ac5e0273aa3e1b5070fc3d7a0dc84}{allocate\_\-field} (\hyperlink{classmdp__lattice}{mdp\_\-lattice} \&a, int n=0)}
\label{classmdp__field_b76ac5e0273aa3e1b5070fc3d7a0dc84}

\begin{CompactList}\small\item\em Allows dynamical allocation of a field that is not allocated. \item\end{CompactList}\item 
\hypertarget{classmdp__field_a581ac8278d31ed9dabbff2df49c7130}{
void \hyperlink{classmdp__field_a581ac8278d31ed9dabbff2df49c7130}{reset\_\-field} ()}
\label{classmdp__field_a581ac8278d31ed9dabbff2df49c7130}

\begin{CompactList}\small\item\em do not use, may cause memory leaks \item\end{CompactList}\item 
\hypertarget{classmdp__field_b063254fe74b88b1c9cc9e0cbc843b4b}{
void \hyperlink{classmdp__field_b063254fe74b88b1c9cc9e0cbc843b4b}{deallocate\_\-field} ()}
\label{classmdp__field_b063254fe74b88b1c9cc9e0cbc843b4b}

\begin{CompactList}\small\item\em dynamically deallocate field \item\end{CompactList}\item 
\hypertarget{classmdp__field_9eec94ee723253a196ccc4677832b4a0}{
T \& \hyperlink{classmdp__field_9eec94ee723253a196ccc4677832b4a0}{operator()} (\hyperlink{classmdp__site}{mdp\_\-site} x, int i=0)}
\label{classmdp__field_9eec94ee723253a196ccc4677832b4a0}

\begin{CompactList}\small\item\em returns component i of the vector of objects T stored at site x \item\end{CompactList}\item 
\hypertarget{classmdp__field_7dab126ffc90476401048cdf747077ef}{
T $\ast$ \hyperlink{classmdp__field_7dab126ffc90476401048cdf747077ef}{operator\mbox{[}$\,$\mbox{]}} (\hyperlink{classmdp__site}{mdp\_\-site} x)}
\label{classmdp__field_7dab126ffc90476401048cdf747077ef}

\begin{CompactList}\small\item\em retruns the address of the vector of objects T stored at site x \item\end{CompactList}\item 
void \hyperlink{classmdp__field_8ff0ae3336b70be5c58299322662275e}{shift} (int i, int mu)
\item 
\hypertarget{classmdp__field_31b1149be220cdeeb72281163579f3bc}{
\hyperlink{classmdp__lattice}{mdp\_\-lattice} \& \hyperlink{classmdp__field_31b1149be220cdeeb72281163579f3bc}{lattice} () const }
\label{classmdp__field_31b1149be220cdeeb72281163579f3bc}

\begin{CompactList}\small\item\em returns by reference the lattice this field is defined on \item\end{CompactList}\item 
\hypertarget{classmdp__field_561106db7c6e94b3b63b3aee6a91bc79}{
long \hyperlink{classmdp__field_561106db7c6e94b3b63b3aee6a91bc79}{field\_\-size} ()}
\label{classmdp__field_561106db7c6e94b3b63b3aee6a91bc79}

\begin{CompactList}\small\item\em returns the total memory in bytes occupied by the field \item\end{CompactList}\item 
\hypertarget{classmdp__field_9f557dfb7bb760e07d4c92b888d8a40e}{
long \hyperlink{classmdp__field_9f557dfb7bb760e07d4c92b888d8a40e}{file\_\-size} ()}
\label{classmdp__field_9f557dfb7bb760e07d4c92b888d8a40e}

\begin{CompactList}\small\item\em returns the total space in bytes required to store the field \item\end{CompactList}\item 
\hypertarget{classmdp__field_433611d33cb6b05627ffbba6a03e3e6f}{
int \hyperlink{classmdp__field_433611d33cb6b05627ffbba6a03e3e6f}{where\_\-global} (long i)}
\label{classmdp__field_433611d33cb6b05627ffbba6a03e3e6f}

\begin{CompactList}\small\item\em only used by \hyperlink{classmdp__field_9f7c113ef1dea753f54d88ff2b854c40}{mdp\_\-field::load()} and \hyperlink{classmdp__field_e0ada48bbeca95e43b5986e3016c25ef}{mdp\_\-field::save()} \item\end{CompactList}\item 
\hypertarget{classmdp__field_be90c49dd292e4f462a55916dacbc88c}{
long \hyperlink{classmdp__field_be90c49dd292e4f462a55916dacbc88c}{global\_\-size} ()}
\label{classmdp__field_be90c49dd292e4f462a55916dacbc88c}

\begin{CompactList}\small\item\em lattice size in units of sizeof(T) \item\end{CompactList}\item 
void \hyperlink{classmdp__field_72b973da706841ea58dc728345d36795}{update} (int np=2, int d=-1, int size=1)
\item 
\hypertarget{classmdp__field_9f7c113ef1dea753f54d88ff2b854c40}{
bool \hyperlink{classmdp__field_9f7c113ef1dea753f54d88ff2b854c40}{load} (string filename, int processIO=0, long max\_\-buffer\_\-size=1024, bool load\_\-header=true, long skip\_\-bytes=0, bool($\ast$user\_\-read)(FILE $\ast$, void $\ast$, long, long, long, const \hyperlink{classmdp__lattice}{mdp\_\-lattice} \&)=0, bool try\_\-switch\_\-endianess=false)}
\label{classmdp__field_9f7c113ef1dea753f54d88ff2b854c40}

\begin{CompactList}\small\item\em Best way to load a field. \item\end{CompactList}\item 
\hypertarget{classmdp__field_e0ada48bbeca95e43b5986e3016c25ef}{
bool \hyperlink{classmdp__field_e0ada48bbeca95e43b5986e3016c25ef}{save} (string filename, int processIO=0, long max\_\-buffer\_\-size=1024, bool load\_\-header=true, long skip\_\-bytes=0, bool($\ast$user\_\-write)(FILE $\ast$, void $\ast$, long, long, long, const \hyperlink{classmdp__lattice}{mdp\_\-lattice} \&)=0)}
\label{classmdp__field_e0ada48bbeca95e43b5986e3016c25ef}

\begin{CompactList}\small\item\em Best way to save a field. \item\end{CompactList}\item 
\hypertarget{classmdp__field_8ad4d41e9c53df910f114031f84e0845}{
bool \hyperlink{classmdp__field_8ad4d41e9c53df910f114031f84e0845}{save\_\-vtk} (string filename, int t=-1, int component=-1, int processIO=0, bool ASCII=false)}
\label{classmdp__field_8ad4d41e9c53df910f114031f84e0845}

\begin{CompactList}\small\item\em Best way to save a field. \item\end{CompactList}\end{CompactItemize}
\subsection*{Public Attributes}
\begin{CompactItemize}
\item 
\hypertarget{classmdp__field_465dfc6a95fe7ca5016595550cd024d9}{
\hyperlink{classmdp__field__file__header}{mdp\_\-field\_\-file\_\-header} \hyperlink{classmdp__field_465dfc6a95fe7ca5016595550cd024d9}{header}}
\label{classmdp__field_465dfc6a95fe7ca5016595550cd024d9}

\begin{CompactList}\small\item\em the field file header, contains data only if field was read from file \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$class T$>$ class mdp\_\-field$<$ T $>$}

most generic field object 

Example: 

\footnotesize\begin{verbatim}
///    int box[]={10,10,10};
///    mdp_lattice lattice(3,box);
///    mdp_field<float> psi(lattice,10);
///    mdp_site x(lattice);
///    forallsites(x)
///      for(int i=0; i<10; i++)
///         psi(x,i)=0.0;
///    psi.update(); // synchronization
///    psi.save("myfield");
///    psi.load("myfield");
/// \end{verbatim}
\normalsize
 

\subsection{Member Function Documentation}
\hypertarget{classmdp__field_8ff0ae3336b70be5c58299322662275e}{
\index{mdp\_\-field@{mdp\_\-field}!shift@{shift}}
\index{shift@{shift}!mdp_field@{mdp\_\-field}}
\subsubsection[{shift}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T $>$ void {\bf mdp\_\-field}$<$ T $>$::shift (int {\em i}, \/  int {\em mu})\hspace{0.3cm}{\tt  \mbox{[}inline\mbox{]}}}}
\label{classmdp__field_8ff0ae3336b70be5c58299322662275e}


shifts the entire fields in direction mu of i steps (i can be positive or negative) note that if i=1, field(x-mu) is assigned to field(x) function requires communication \hypertarget{classmdp__field_72b973da706841ea58dc728345d36795}{
\index{mdp\_\-field@{mdp\_\-field}!update@{update}}
\index{update@{update}!mdp_field@{mdp\_\-field}}
\subsubsection[{update}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T $>$ void {\bf mdp\_\-field}$<$ T $>$::update (int {\em np} = {\tt 2}, \/  int {\em d} = {\tt -1}, \/  int {\em ncomp} = {\tt 1})\hspace{0.3cm}{\tt  \mbox{[}inline\mbox{]}}}}
\label{classmdp__field_72b973da706841ea58dc728345d36795}


the most important communication function in MDP. it must be called after each field variables are modified. it restores the syncronization between parallel processes.

The only communication function for a field object To be invoked every time field variables are assigned and Need to be sinchronized between the parallel processes 

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
/Users/mdipierro/Desktop/SciDac/development/Libraries/\hyperlink{mdp__field_8h}{mdp\_\-field.h}\item 
/Users/mdipierro/Desktop/SciDac/development/Libraries/\hyperlink{mdp__field__load_8h}{mdp\_\-field\_\-load.h}\item 
/Users/mdipierro/Desktop/SciDac/development/Libraries/\hyperlink{mdp__field__save_8h}{mdp\_\-field\_\-save.h}\item 
/Users/mdipierro/Desktop/SciDac/development/Libraries/mdp\_\-field\_\-save\_\-vtk.h\item 
/Users/mdipierro/Desktop/SciDac/development/Libraries/\hyperlink{mdp__field__update_8h}{mdp\_\-field\_\-update.h}\end{CompactItemize}
